package mes.kanban.respository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import mes.kanban.entity.MesUser;

/**
 * 用户信息
 * @author gjy
 *
 * 2018年2月6日下午6:03:04
 */
@Repository
public interface UserMessageRespository extends JpaRepository<MesUser, String>{

	@Query("from MesUser where userCode = ?1 and passWord = ?2")
	List<MesUser> findUsersByOther(String userCode, String password);

	@Query("from MesUser where userCode = ?1 and status = 1")
	List<MesUser> findUsersByCode(String userCode);

	@Modifying
	@Query(value="delete from MesUserAndRole where userId = ?1")
	void deleteRoleUser(String userId);

}
